package com.acegear.horizon.domain.repository.jpa;

import com.acegear.horizon.domain.models.jpa.AGDaily;

import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;
import java.util.Optional;

/**
 * Created by wangsike on 2016/12/22.
 */
public interface AGDailyRepository extends PagingAndSortingRepository<AGDaily, Long> {
    Optional<AGDaily> findTopByOrderByDateDesc();

    Optional<AGDaily> findTopByDateLessThanOrderByDateDesc(Long date);

    Optional<AGDaily> findTopByDateGreaterThanOrderByDateAsc(Long date);

    List<AGDaily> findByOrderByDateDesc(Pageable pageable);

    Optional<AGDaily> findTopByDailyId(Long dailyId);
}
